

/* 

Paper: Gentrification and pioneer businesses 
Authors: Behrens, Boulam, Martin, Mayneris 

Name dofile: compute_elasticity_negbinblkgp.do  
Version: 12 nov. 2021 

Output: 15 datasets with the elasticty of of the number of establishments to gentrification  
(9 measures of gentrifications {sh_edu pc_income, gentri} X {250m, 500m, contig})

Inputs:

- naics_id_conc_database_blkgp.dta 
- blkgrp_pop_income.dta 

*/ 


global dep nb_plants_sect
global base_demo blkgrp_pop_income

// Gentrification measured using income per capita 
use naics_id_conc_database_blkgp, clear 
sort naics 
egen sect=group(naics) 
sum sect 
global max = r(max) 
global label _pc
global condition if emp>0
global explanatory lpop lemp lcrent poor1990 pc_gr1990_poor
global output pioneer_gentri90_blkgrp_negbin$label
	cd $dopath
	do negbinomial_nb_estab_blkgrp_rev

// Gentrification measured using the share of educated 	
use naics_id_conc_database_blkgp, clear 
sort naics 
egen sect=group(naics) 
sum sect 
global max = r(max) 
global label _sh_edu
global condition if emp>0
global explanatory lpop lemp lcrent poor1990 sh_edu_gr1990_poor
global output pioneer_gentri90_blkgrp_negbin$label
	cd $dopath
	do negbinomial_nb_estab_blkgrp_rev

// Gentrification measured using the gentrification dummy	
use naics_id_conc_database_blkgp, clear 
sort naics 
egen sect=group(naics) 
sum sect 
global max = r(max) 
global label _gentri
global condition if emp>0
global explanatory lpop lemp lcrent poor1990 gentri_9000
global output pioneer_gentri90_blkgrp_negbin$label
	cd $dopath
	do negbinomial_nb_estab_blkgrp_rev
	
	
	